<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>函数传参匹配</title>
    <script>
        function fun(a,b){
            if(fun.length == arguments.length){
                console.log(a+b);
            }else{
                console.error("传递参数不匹配")
            }
        }
        fun(1,2);
        fun(1,2,3);
    </script>
</head>
<body>

</body>
</html>